<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <style>
        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            background-color: #f0f0f0;
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
        }
        #gameCanvas {
            border: 2px solid #333;
            background-color: #fff;
            margin-bottom: 20px;
        }
        .controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
        }
        .speed-control {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        #score {
            font-size: 24px;
            font-weight: bold;
            color: #333;
        }
        button {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
        }
        button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <canvas id="gameCanvas" width="400" height="400"></canvas>
    <div class="controls">
        <div class="speed-control">
            <label for="speed">速度：</label>
            <input type="range" id="speed" min="1" max="10" value="5">
            <span id="speedValue">5</span>
        </div>
        <div id="score">分数：0</div>
        <button id="startBtn">开始游戏</button>
    </div>
    <script src="game.js"></script>
</body>
</html>